﻿<loki:ViewControl
    x:TypeArguments="lunavm:ConnectorViewModel"
    xmlns:lunavm="clr-namespace:Luna.UI.Configuration;assembly=Luna.Core"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:loki="clr-namespace:Loki.UI.Wpf;assembly=Loki.UI.Wpf"
    xmlns:luna="clr-namespace:Luna.UI;assembly=Luna.Core"
    xmlns:local="clr-namespace:Luna.UI.Wpf"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="Luna.UI.Wpf.ConnectorConfigurationView"
    d:DesignWidth="448.8" d:DesignHeight="428.8">

    <dxlc:LayoutControl Orientation="Horizontal" DataContext="{Binding ConnectorConfiguration}">
        <dxlc:LayoutControl.Resources>
            <Style TargetType="Image" x:Key="converter_style">
                <Setter Property="Width" Value="24" />
                <Setter Property="Height" Value="24" />
                <Setter Property="Stretch" Value="UniformToFill" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=Enabled}" Value="True">
                        <Setter Property="Source" Value="{StaticResource IMG_connector_enabled}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=Enabled}" Value="False">
                        <Setter Property="Source" Value="{StaticResource IMG_connector_disabled}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="Image" x:Key="converter_style_small" BasedOn="{StaticResource converter_style}">
                <Setter Property="Width" Value="16" />
                <Setter Property="Height" Value="16" />
                <Setter Property="Margin" Value="0,0,3,0" />
            </Style>
        </dxlc:LayoutControl.Resources>
        <dxlc:LayoutGroup View="Tabs" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <dxlc:LayoutGroup Orientation="Vertical" DataContext="{Binding Google}" Header="{Binding}">
                <dxlc:LayoutGroup.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource converter_style_small}" />
                            <TextBlock Text="Google" />
                        </StackPanel>
                    </DataTemplate>
                </dxlc:LayoutGroup.HeaderTemplate>
                <dxlc:LayoutItem Label="Activated">
                    <Image Style="{StaticResource converter_style}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Login">
                    <dxe:TextEdit EditValue="{Binding Login}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Password">
                    <dxe:TextEdit EditValue="{Binding Password}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem>
                    <Button Content="Test" Command="{Binding Test}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem>
                    <Button Content="OK"  Command="{Binding Save}" />
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
            <dxlc:LayoutGroup  Orientation="Vertical"  DataContext="{Binding ZohoCRM}" Header="{Binding}">
                <dxlc:LayoutGroup.HeaderTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource converter_style_small}" />
                            <TextBlock Text="Zoho CRM" />
                        </StackPanel>
                    </DataTemplate>
                </dxlc:LayoutGroup.HeaderTemplate>
                <dxlc:LayoutItem Label="Activated">
                    <Image Style="{StaticResource converter_style}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Login">
                    <dxe:TextEdit EditValue="{Binding Login}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Password">
                    <dxe:TextEdit EditValue="{Binding Password}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Api Key">
                    <dxe:TextEdit EditValue="{Binding ApiKey}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem>
                    <Button Content="Test" Command="{Binding Test}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem>
                    <Button Content="OK"  Command="{Binding Save}" />
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
        </dxlc:LayoutGroup>
    </dxlc:LayoutControl>
</loki:ViewControl>